import fly from "../utils/fly.js"
export const SERVER_HTTP = `https://dgateway.allhome.com.cn/hiddencallmini/platformHouseHiddenCall/miniapp`
// export const SERVER_HTTP = `https://nhousehiddencall.allhome.com.cn/platformHouseHiddenCall/miniapp`
export const IMG_HTTP = `https://qjdev-pred-images.oss-cn-beijing.aliyuncs.com`
export const VIDEO_HTTP = `https://qjvideo.oss-cn-beijing.aliyuncs.com`
export const VOICE_HTTP = `https://qjvoice.oss-cn-beijing.aliyuncs.com`
/**
 * 数据接口文件
 * - @author          狄兆璐
 * - @date   2018-10-29         
 * - @updater          
 * - @update_date      
 * - @update_info      
 */
export class HiddenCall {
  // 上传图片
  uploadImage = (path) => {
    return http.uploadFile(`${IMG_HTTP}`, path)
  }
  //上传视频
  uploadVideo = (path) => {
    return http.uploadFile(`${VIDEO_HTTP}`, path)
  }
  // 上传音频
  uploadVoice = (path) => {
    return http.uploadFile(`${VOICE_HTTP}`, path)
  }
  //　查询通话服务
  callTask = () => {
    return fly.get(`${SERVER_HTTP}/followUpDescription/calltask`)
  }
  // 区域字典表
  regionList = () => {
    return fly.get(`${SERVER_HTTP}/searchCondition/region`)
  }
  // 搜索条件字典表
  searchList = () => {
    return fly.get(`${SERVER_HTTP}/searchCondition/queryItems`)
  }
  // 房源列表
  houseList = (data) => {
    return fly.post(`${SERVER_HTTP}/page/housePageQuery/v2`, data)
  }
  // 房源列表图片
  houseListImage = (data) => {
    return fly.post(`${SERVER_HTTP}/page/houseImageUrl`, data)
  }
  // 电话列表
  callList = (data) => {
    return fly.post(`${SERVER_HTTP}/page/callRecordsPageQuery/v1`, data)
  }
  // 阅读消息列表
  readMessage = (data) => {
    return fly.get(`${SERVER_HTTP}/message/read/v1/${data}`)
  }
  // 获取消息列表
  messageList = (data) => {
    return fly.post(`${SERVER_HTTP}/message/page/v1`, data)
  }
  // 房源筛选条件新增
  houseFilterAdd = (data) => {
    return fly.post(`${SERVER_HTTP}/screening/houseScreeningAdd`, data)
  }
  // 房源筛选条件修改
  houseFilterModify = (data) => {
    return fly.post(`${SERVER_HTTP}/screening/houseScreeningModify`, data)
  }
  // 客源列表
  customerList = (data) => {
    return fly.post(`${SERVER_HTTP}/page/customerPageQuery/v1`, data)
  }
  // 客源筛选条件新增
  customerFilterAdd = (data) => {
    return fly.post(`${SERVER_HTTP}/screening/customerScreeningAdd`, data)
  }
  // 客源筛选条件修改
  customerFilterModify = (data) => {
    return fly.post(`${SERVER_HTTP}/screening/customerScreeningModify`, data)
  }
  // 房源列表图片查看
  imageList = (resourceCode) => {
    return fly.get(`${SERVER_HTTP}/media/listImages/${resourceCode}`)
  }
  // 获取短信内容
  smsContent = (id) => {
    return fly.get(`${SERVER_HTTP}/sendMessage/content/${id}`)
  }
  // 拨打电话
  directCall = (data) => {
    return fly.post(`${SERVER_HTTP}/calls/directCall/`, data)
  }
  // 媒体上传
  addMedia = (data) => {
    return fly.post(`${SERVER_HTTP}/media/add`, data)
  }
  // 查看电话
  lookPhone = (resourceCode) => {
    return fly.get(`${SERVER_HTTP}/operation/lookPhone/v1/${resourceCode}`)
  }
  // 拨号查询
  callQuery = (resourceCode) => {
    return fly.get(`${SERVER_HTTP}/operation/callQuery/${resourceCode}`)
  }
  // 取消展示
  cancelShow = (resourceCode) => {
    return fly.get(`${SERVER_HTTP}/operation/cancel/${resourceCode}`)
  }
  // 解除限制拨打
  freeCall = (data) => {
    return fly.post(`${SERVER_HTTP}/calls/freeCall`, data)
  }
  // 房源筛选条件修改获取
  houseFilterGet = (id) => {
    return fly.get(`${SERVER_HTTP}/screening/houseScreeningModify//${id}`)
  }
  // 客源筛选条件修改获取
  customerFilterGet = (id) => {
    return fly.get(`${SERVER_HTTP}/screening/customerScreeningModify//${id}`)
  }
  // 收藏夹字典表
  favouritesList = (uType) => {
    return fly.get(`${SERVER_HTTP}/queryfavorite/name/${uType}`)
  }
  //房源筛选条件列表
  houseFilterList = () => {
    return fly.get(`${SERVER_HTTP}/screening/houseScreeningQuery`)
  }
  // 客源筛选条件列表
  customerFilterList = () => {
    return fly.get(`${SERVER_HTTP}/screening/customerScreeningQuery`)
  }
  // 写描述
  addDescription = (data) => {
    return fly.post(`${SERVER_HTTP}/followUpDescription/descriptionAdd`, data)
  }
  // 写跟进
  addFollowup = (data) => {
    return fly.post(`${SERVER_HTTP}/followUpDescription/followUpAdd`, data)
  }
  // 房客源取消收藏创建文件夹
  cancelFavorites = (data) => {
    return fly.post(`${SERVER_HTTP}/addfavorite/cancel`, data)
  }
  // 房客源添加收藏创建文件夹
  addFavorites = (data) => {
    return fly.post(`${SERVER_HTTP}/addfavorite/add`, data)
  }
  // 房源筛选条件删除
  houseFilterDel = (id) => {
    return fly.get(`${SERVER_HTTP}/screening/houseScreeningDelete/${id}`)
  }
  // 客源筛选条件删除
  customerFilterDel = (id) => {
    return fly.get(`${SERVER_HTTP}/screening/customerScreeningDelete/${id}`)
  }
  // 房源详情，客源详情, 电话
  queryDetail = (data) => {
    return fly.post(`${SERVER_HTTP}/mainBusiness/querydetail`, data)
  }
  // 查询客源收藏夹
  queryCustomerFavorite = () => {
    return fly.get(`${SERVER_HTTP}/queryfavorite/name/customer`)
  }
  //　房客源详情底部tab
  queryInfo = (data) => {
    return fly.post(`${SERVER_HTTP}/infoRecord/queryinfoRecord`, data)
  }
  // 获取分享好友
  shareFirendList = () => {
    return fly.get(`${SERVER_HTTP}/shareFirendList`)
  }
  // 获取详情里的媒体图片录音
  pathList = (resourceCode) => {
    return fly.get(`${SERVER_HTTP}/media/listMedias/${resourceCode}`)
  }
  // 删除详情媒体
  pathErase = (data) => {
    return fly.post(`${SERVER_HTTP}/media/erase`, data)
  }
  // 获取用户信息
  getUserInfo = () => {
    return fly.get(`${SERVER_HTTP}/logIn/accountInfo`)
  }
  // 获取通信录列表
  maillingList = () => {
    return fly.get(`${SERVER_HTTP}/maillingList`)
  }
  // 通信录详情
  maillingDetail = () => {
    return fly.get(`${SERVER_HTTP}/maillingDetail`)
  }
  // 收藏夹分类列表
  favoriteList = (data) => {
    return fly.post(`${SERVER_HTTP}/FavouriteList/queryFavouriteList`, data)
  }
  // 查询房源收藏夹
  queryHouseFavorite = (data) => {
    return fly.get(`${SERVER_HTTP}/queryfavorite/name/house`)
  }
  // 修改手机号
  modifyPhone = (data) => {
    return fly.post(`${SERVER_HTTP}/account/modifyPhone`, data)
  }
  // 修改密码
  modifyPassword = (data) => {
    //  `http://192.168.10.58:8899/base/authentication/account/modifyPassword
    return fly.post(`${SERVER_HTTP}/account/modifyPassword`, data)
  }
  // 获取发送短信的号码
  messageNum = (data) => {
    return fly.get(`${SERVER_HTTP}/sendMessage/queryPhones/${data}`)
  }
  // 获取虚拟号
  virtualNumber = () => {
    return fly.get(`${SERVER_HTTP}/sendMessage/queryVirtual`)
  }
  // 获取发送短信的模板
  getTemplate = (data) => {
    return fly.get(`${SERVER_HTTP}/sendMessage/dictionary/${data}`)
  }

  // 发送短信
  sendValue = (data) => {
    return fly.post(`${SERVER_HTTP}/sendMessage/sms`, data)
  }
  // 发送短信
  save_formids = (data) => {
    return fly.post(`${SERVER_HTTP}/message/saveFormIds`, data)
  }
  // 查询短信记录
  queryMessage = (data) => {
    return fly.post(`${SERVER_HTTP}/messageUpstream/recordPage`, data)
  }
  //短信列表
  smsList = (data) => {
    return fly.post(`${SERVER_HTTP}/messageUpstream/smsPage`, data)
  }
  // 转文字
  turnText = (data) => {
    return fly.post(`https://voice.allhome.com.cn/voicetotext/recordingtotext/record/url`, data)
  }

  // 获取更新小程序版本错误接口
  errorMessage = (data) => {
    return fly.post(`${SERVER_HTTP}/errormessage/faultMessage`, data)
  }
  // 获取验证码
  getTestCode = (data) => {
    return fly.get(`${SERVER_HTTP}/forgetPassword/sendAuthCode/${data}`)
  }
  /**
   * 获取跟进类型
   */
  getFollowUpType = () => {
    return fly.get(`${SERVER_HTTP}/followUpDescription/followUpMainType`)
  }
  /**
    * 获取跟进下级类型
    */
  subordinateType = (code, utype) => {
    return fly.get(`${SERVER_HTTP}/followUpDescription/followUpLowerType/${code}/${utype}`)
  }
  /**
    * 获取有效跟进类型
    */
  effectiveFollowUpType = () => {
    return fly.get(`${SERVER_HTTP}/followUpDescription/validFollowUpLower`)
  }
  /**
    * 获取无效跟进类型
    */
  invalidFollowUpType = () => {
    return fly.get(`${SERVER_HTTP}/followUpDescription/dimmedFollowUpLower`)
  }
  // 获取楼牌号
  lookHouseNumber = (data) => {
    return fly.get(`${SERVER_HTTP}/operation/queryHouseNumber/${data}`)
  }
  // 获取长短号
  lengthNumber = (data) => {
    return fly.get(`${SERVER_HTTP}/calls/queryDirect/${data}`)
  }
  // 获取长短号详细信息
  lengthNumberInfo = (data) => {
    return fly.get(`https://virtualadmin.allhome.com.cn/virtualNumberUse/virtualNumberInfo/${data}`)
  }
  // 更新楼牌号
  modifyHouseNumber = (data) => {
    return fly.put(`${SERVER_HTTP}/house/houseNumber`, data)
  }
  // 是否可以查看修改楼牌号
  lookHouseBoolean = (data) => {
    return fly.get(`${SERVER_HTTP}/operation/buttonSwitch/${data}`)
  }
  // 发送token
  sendToken = () => {
    return fly.get(`${SERVER_HTTP}/init`)
  }
  //验证跟进填写是否完成
  followFinished = () => {
    return fly.get(`${SERVER_HTTP}/followUpInspection/directCallInspection`)
  }
  //获取行政区名
  erpDistrict =()=>{
    return fly.get(`${SERVER_HTTP}/erp/v3/erpDistrict`)
  }
  //获取片区名
  erpRegion =(data) => {
    return fly.get(`${SERVER_HTTP}/erp/v3/erpRegion/${data}`)
  }
  //获取小区名
  erpCommunity = (data) => {
    return fly.get(`${SERVER_HTTP}/erp/v3/erpCommunity/${data}`)
  }
  //保存修改的房源信息
  changeHouseInfo = (data) => {
    return fly.put(`${SERVER_HTTP}/house/houseNumber`,data)
  }
  //小区名模糊查询
  erpKeyword = (data) => {
    return fly.get(`${SERVER_HTTP}/erp/v3/erpKeyword/${data}`)
  }
}